$(function() {
	var userGrid = $("#SpareBedroomGrid");
	var bedroomType=$("#bedroomType").val();
	var bedroomId=$("#bedroomI").val();
		
	userGrid.datagrid({
		url: 'bedroomDetails/bedroomlist'+ (bedroomType ? ("/" + bedroomType) : "")+ (bedroomId ? ("/" + bedroomId) : ""),
		fit: true,
		pagination: true,
		border: false,
		rownumbers:true,
		emptyMsg:"<img  src='public/images/noThree.png'>",
		singleSelect:true,
		fitColumns:true,
		columns: [
			[ {
				field: 'id',
				width: 20,
				align: 'center',
				hidden: true
			}, {
				field: 'name',
				title: '寝室名',
				align: 'center',
				width: 50,
				hidden: false
			}, {
				field: 'bedroomType',
				title: '寝室类型',
				align: 'center',
				width: 50,
				hidden: false
			},{
				field: 'count',
				title: '已住人数',
				align: 'center',
				width: 50,
				hidden: false
			},{
				field: 'bed',
				title: '上限人数',
				align: 'center',
				width: 50,
				hidden: false
			}]
		]
	});

});